package com.flx.at.spring.code.trans.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class BankDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    /**
     * 银行扣钱
     */
    public int reduceMoney(String account,int money){
        String sql = "update bank_money set money=money-? where account = ?";
        return jdbcTemplate.update(sql,money,account);
    }

}
